package com.neusoft.weixin.service.account;


import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springside.modules.utils.DateProvider;

import com.neusoft.weixin.entity.User;
import com.neusoft.weixin.repository.account.UserDao;


/**
 * 用户管理类.
 * 
 * @author calvin
 */
@Service(value = "accountService")
public class AccountService {

	public static final String HASH_ALGORITHM = "SHA-1";
	public static final int HASH_INTERATIONS = 1024;
	public static final int SALT_SIZE = 8;

	private static Logger logger = LoggerFactory.getLogger(AccountService.class);

	private DateProvider dateProvider = DateProvider.DEFAULT;
	
	@Autowired
	private UserDao userDao;
	
	/**
	 * 
	 * @param id
	 * @return
	 */
	public User getUser(String id) {
		return null;
	}
	


	/**
	 * 登陆根据username获取user对象
	 * @param loginName
	 * @return
	 */
	public User findUserByLoginName(String loginName) throws Exception {
		logger.info("---userDao:findUserByLoginName:start---"+loginName);
		return userDao.getByName(loginName);
	}
	

}
